package com.beta.cust.bind.config;

import com.beta.cat.service.RedissonService;
import com.beta.cat.utils.sequence.builder.RedisSeqBuilder;
import com.beta.cat.utils.sequence.seq.Sequence;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置常用的序列号生成类
 *
 * @author taofucheng
 * @date 2024/4/15
 */
@Configuration
public class SequenceConfig {
    @Bean("smsSequence")
    public Sequence createSmsSequence(RedissonService redissonService) {
        return RedisSeqBuilder.create().redissonService(redissonService).bizName("S").stepStart(100000).step(1000).build();
    }

    @Bean("detailSequence")
    public Sequence createDetailSequence(RedissonService redissonService) {
        return RedisSeqBuilder.create().redissonService(redissonService).bizName("D").stepStart(100000).step(1000).build();
    }
}
